//引入vue模块
import vue from "vue";
//cnpm i --save-dev vue-router
//引入vue-router模块
import vueRouter from "vue-router";

//给vue模块增加路由功能
vue.use(vueRouter);

//引入路由
import singer from "../components/singer.vue";
import top from "../components/top.vue";
import recommended from "../components/recommended.vue";
import search from "../components/search.vue";
import index from "../components/index.vue";
import tjGd from "../components/tj_gd.vue";
import details from "../components/singDetails.vue";
import play from "../components/play.vue";
import songPl from "../components/songPl.vue";
import hotsongs from "../components/hotSongs.vue";
import zj from "../components/sing_zj.vue";
import xq from "../components/sing_xq.vue";

//引入子路由

//路由配置
const route = [
	{path:"/",component:index,
	children:[
		{path:"",redirect:"recommended"},
//		{path:"singer",component:singer,
		{path:"singer",component:singer},
		{path:"top",component:top},
		{path:"recommended",component:recommended},
		{path:"search",component:search},
	]},
	{path:"/tjGd",component:tjGd},
	{path:"/details",component:details,
	children:[
		{path:"",redirect:"hotsongs"},
		{path:"hotsongs",component:hotsongs},
		{path:"zj",component:zj},
		{path:"xq",component:xq},
		
	]},
	{path:"/play",component:play},
	{path:"/songPl",component:songPl}
	
	
	
];

//创建router实例
const router = new vueRouter({
	routes:route
})

//输出router实例
export default router;